<template>
  <div class="work">
    <div style="display: flex">
      <div>
        <van-image
          class="tx"
          round
          fit="cover"
          src="https://img01.yzcdn.cn/vant/cat.jpeg"
        />
      </div>
      <div>
        <span class="spname">{{ item.uname }}</span>
        <span class="sptime">{{ item.create_at }}</span>
      </div>
    </div>
    <div>
      <span class="spnr">{{ item.content }}</span>
      <div class="main" v-if="item.img[0]">
        <van-image
          v-for="(src, i) in item.img"
          :key="i"
          class="img2"
          width="150"
          fit="cover"
          :src="src"
        />
      </div>
    </div>
    <div class="dibu">
      <div class="dibu1">
        <div class="dibu2">
          <img class="dz" src="/baking_log/dianzan.png" alt="" />
        </div>
        <div class="dibu3">{{ item.upvote }}</div>
      </div>
      <div class="dibu1">
        <div class="dibu2">
          <img class="dz" src="/baking_log/dashang.png" alt="" />
        </div>
        <div class="dibu3">{{ item.reward }}</div>
      </div>
      <div class="dibu1" style="border: 0">
        <div class="dibu2">
          <img class="dz" src="/baking_log/pinglun.png" alt="" />
        </div>
        <span class="dibu3">{{ item.comment }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    item: { type: Object, required: true },
  },
};
</script>

<style scoped>
.work {
  background-color: #fff;
  padding: 10px 15px 0;
  margin-bottom: 10px;
}
.tx {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}
.spname {
  height: 20px;
  max-width: 100%;
  margin-right: 0;
  font-size: 13px;
  height: 20px;
  line-height: 20px;
  text-align: left;
  color: #4a4945;
  display: block;
}
.sptime {
  font-size: 12px;
  height: 20px;
  line-height: 20px;
  color: #999999;
  display: block;
}
.spnr {
  margin: 10px 0;
  font-size: 14px;
  color: #4a4945;
  line-height: 20px;
  max-height: 80px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.main {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.img2 {
  margin: 0 5px 10px 0;
}
.dr {
  width: 40px;
  height: 40px;
  position: relative;
  top: -10px;
}
.dibu {
  height: 30px;
  box-sizing: border-box;
  /* margin: 0 10px; */
  border-top: 1px solid #e7e2e5;
}
.dibu1 {
  display: inline-block;
  width: 33.333%;
  text-align: center;
  height: 20px;
  line-height: 20px;
  margin-top: 4px;
  box-sizing: border-box;
  border-right: 1px solid #e7e2e5;
}
.dibu2 {
  font-size: 0;
  width: 19px;
  height: 19px;
  vertical-align: top;
  display: inline-block;
}
.dz {
  width: 100%;
  overflow: hidden;
}
.dibu3 {
  font-size: 12px;
  color: #999999;
  margin-left: 5px;
  vertical-align: middle;
  display: inline-block;
}
</style>

<style lang="scss" scoped></style>
